\(\int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx\) [68]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 158 \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {a^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {3 a b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {a^2 b \sec ^3(c+d x)}{d}-\frac {b^3 \sec ^3(c+d x)}{3 d}+\frac {b^3 \sec ^5(c+d x)}{5 d}+\frac {a^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {3 a b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {3 a b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \]

[Out]

1/2*a^3*arctanh(sin(d*x+c))/d-3/8*a*b^2*arctanh(sin(d*x+c))/d+a^2*b*sec(d*x+c)^3/d-1/3*b^3*sec(d*x+c)^3/d+1/5*
b^3*sec(d*x+c)^5/d+1/2*a^3*sec(d*x+c)*tan(d*x+c)/d-3/8*a*b^2*sec(d*x+c)*tan(d*x+c)/d+3/4*a*b^2*sec(d*x+c)^3*ta
n(d*x+c)/d

Rubi [A] (verified)

Time = 0.21 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3169, 3853, 3855, 2686, 30, 2691, 14} \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {a^3 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^3 \tan (c+d x) \sec (c+d x)}{2 d}+\frac {a^2 b \sec ^3(c+d x)}{d}-\frac {3 a b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {3 a b^2 \tan (c+d x) \sec ^3(c+d x)}{4 d}-\frac {3 a b^2 \tan (c+d x) \sec (c+d x)}{8 d}+\frac {b^3 \sec ^5(c+d x)}{5 d}-\frac {b^3 \sec ^3(c+d x)}{3 d} \]

[In]

Int[Sec[c + d*x]^6*(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]

[Out]

(a^3*ArcTanh[Sin[c + d*x]])/(2*d) - (3*a*b^2*ArcTanh[Sin[c + d*x]])/(8*d) + (a^2*b*Sec[c + d*x]^3)/d - (b^3*Se
c[c + d*x]^3)/(3*d) + (b^3*Sec[c + d*x]^5)/(5*d) + (a^3*Sec[c + d*x]*Tan[c + d*x])/(2*d) - (3*a*b^2*Sec[c + d*
x]*Tan[c + d*x])/(8*d) + (3*a*b^2*Sec[c + d*x]^3*Tan[c + d*x])/(4*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3169

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[cos[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (a^3 \sec ^3(c+d x)+3 a^2 b \sec ^3(c+d x) \tan (c+d x)+3 a b^2 \sec ^3(c+d x) \tan ^2(c+d x)+b^3 \sec ^3(c+d x) \tan ^3(c+d x)\right ) \, dx \\ & = a^3 \int \sec ^3(c+d x) \, dx+\left (3 a^2 b\right ) \int \sec ^3(c+d x) \tan (c+d x) \, dx+\left (3 a b^2\right ) \int \sec ^3(c+d x) \tan ^2(c+d x) \, dx+b^3 \int \sec ^3(c+d x) \tan ^3(c+d x) \, dx \\ & = \frac {a^3 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {3 a b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{2} a^3 \int \sec (c+d x) \, dx-\frac {1}{4} \left (3 a b^2\right ) \int \sec ^3(c+d x) \, dx+\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int x^2 \, dx,x,\sec (c+d x)\right )}{d}+\frac {b^3 \text {Subst}\left (\int x^2 \left (-1+x^2\right ) \, dx,x,\sec (c+d x)\right )}{d} \\ & = \frac {a^3 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 b \sec ^3(c+d x)}{d}+\frac {a^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {3 a b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {3 a b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {1}{8} \left (3 a b^2\right ) \int \sec (c+d x) \, dx+\frac {b^3 \text {Subst}\left (\int \left (-x^2+x^4\right ) \, dx,x,\sec (c+d x)\right )}{d} \\ & = \frac {a^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {3 a b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {a^2 b \sec ^3(c+d x)}{d}-\frac {b^3 \sec ^3(c+d x)}{3 d}+\frac {b^3 \sec ^5(c+d x)}{5 d}+\frac {a^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {3 a b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {3 a b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(464\) vs. \(2(158)=316\).

Time = 1.32 (sec) , antiderivative size = 464, normalized size of antiderivative = 2.94 \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {\sec ^5(c+d x) \left (960 a^2 b+64 b^3+320 \left (3 a^2 b-b^3\right ) \cos (2 (c+d x))-300 a^3 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+225 a b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-60 a^3 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+45 a b^2 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-150 a \left (4 a^2-3 b^2\right ) \cos (c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+300 a^3 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-225 a b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+60 a^3 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-45 a b^2 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+240 a^3 \sin (2 (c+d x))+540 a b^2 \sin (2 (c+d x))+120 a^3 \sin (4 (c+d x))-90 a b^2 \sin (4 (c+d x))\right )}{1920 d} \]

[In]

Integrate[Sec[c + d*x]^6*(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]

[Out]

(Sec[c + d*x]^5*(960*a^2*b + 64*b^3 + 320*(3*a^2*b - b^3)*Cos[2*(c + d*x)] - 300*a^3*Cos[3*(c + d*x)]*Log[Cos[
(c + d*x)/2] - Sin[(c + d*x)/2]] + 225*a*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 60*a^
3*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 45*a*b^2*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] -
 Sin[(c + d*x)/2]] - 150*a*(4*a^2 - 3*b^2)*Cos[c + d*x]*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c
 + d*x)/2] + Sin[(c + d*x)/2]]) + 300*a^3*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] - 225*a*b^
2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 60*a^3*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] + S
in[(c + d*x)/2]] - 45*a*b^2*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 240*a^3*Sin[2*(c + d*x
)] + 540*a*b^2*Sin[2*(c + d*x)] + 120*a^3*Sin[4*(c + d*x)] - 90*a*b^2*Sin[4*(c + d*x)]))/(1920*d)

Maple [A] (verified)

Time = 1.62 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.97

method result size
parts \(\frac {a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {b^{3} \left (\frac {\sec \left (d x +c \right )^{5}}{5}-\frac {\sec \left (d x +c \right )^{3}}{3}\right )}{d}+\frac {3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}+\frac {a^{2} b \sec \left (d x +c \right )^{3}}{d}\) \(154\)
derivativedivides \(\frac {a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {a^{2} b}{\cos \left (d x +c \right )^{3}}+3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )}{d}\) \(198\)
default \(\frac {a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {a^{2} b}{\cos \left (d x +c \right )^{3}}+3 a \,b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )}{d}\) \(198\)
parallelrisch \(\frac {-600 \left (a^{2}-\frac {3 b^{2}}{4}\right ) \left (\frac {\cos \left (5 d x +5 c \right )}{10}+\frac {\cos \left (3 d x +3 c \right )}{2}+\cos \left (d x +c \right )\right ) a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+600 \left (a^{2}-\frac {3 b^{2}}{4}\right ) \left (\frac {\cos \left (5 d x +5 c \right )}{10}+\frac {\cos \left (3 d x +3 c \right )}{2}+\cos \left (d x +c \right )\right ) a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (600 a^{2} b -80 b^{3}\right ) \cos \left (3 d x +3 c \right )+\left (120 a^{2} b -16 b^{3}\right ) \cos \left (5 d x +5 c \right )+\left (960 a^{2} b -320 b^{3}\right ) \cos \left (2 d x +2 c \right )+\left (240 a^{3}+540 a \,b^{2}\right ) \sin \left (2 d x +2 c \right )+\left (120 a^{3}-90 a \,b^{2}\right ) \sin \left (4 d x +4 c \right )+\left (1200 a^{2} b -160 b^{3}\right ) \cos \left (d x +c \right )+960 a^{2} b +64 b^{3}}{120 d \left (\cos \left (5 d x +5 c \right )+5 \cos \left (3 d x +3 c \right )+10 \cos \left (d x +c \right )\right )}\) \(284\)
risch \(-\frac {{\mathrm e}^{i \left (d x +c \right )} \left (60 i a^{3} {\mathrm e}^{8 i \left (d x +c \right )}-45 i a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+120 i a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+270 i a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-480 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+160 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-960 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}-64 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-120 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-270 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-480 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+160 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-60 i a^{3}+45 i a \,b^{2}\right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {a^{3} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{2 d}-\frac {3 a \,b^{2} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{8 d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 a \,b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) \(335\)
norman \(\frac {-\frac {30 a^{2} b -4 b^{3}}{15 d}-\frac {6 a^{2} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}}{d}-\frac {2 \left (3 a^{2} b +2 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{d}+\frac {2 \left (15 a^{2} b -20 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{3 d}-\frac {2 \left (15 a^{2} b +4 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{15 d}-\frac {2 \left (15 a^{2} b +34 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{15 d}-\frac {2 \left (15 a^{2} b +88 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{15 d}+\frac {3 a \left (4 a^{2}-21 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}-\frac {3 a \left (4 a^{2}-21 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {3 a \left (4 a^{2}-13 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}-\frac {3 a \left (4 a^{2}-13 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}-\frac {a \left (4 a^{2}+3 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {a \left (4 a^{2}+3 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{15}}{4 d}-\frac {a \left (4 a^{2}+27 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {a \left (4 a^{2}+27 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{4 d}+\frac {2 b \left (15 a^{2}-26 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{3 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{5} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {a \left (4 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {a \left (4 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(519\)

[In]

int(sec(d*x+c)^6*(cos(d*x+c)*a+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

a^3/d*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+b^3/d*(1/5*sec(d*x+c)^5-1/3*sec(d*x+c)^3)+3*a*
b^2/d*(1/4*sin(d*x+c)^3/cos(d*x+c)^4+1/8*sin(d*x+c)^3/cos(d*x+c)^2+1/8*sin(d*x+c)-1/8*ln(sec(d*x+c)+tan(d*x+c)
))+a^2*b*sec(d*x+c)^3/d

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 147, normalized size of antiderivative = 0.93 \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 48 \, b^{3} + 80 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (6 \, a b^{2} \cos \left (d x + c\right ) + {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \]

[In]

integrate(sec(d*x+c)^6*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

1/240*(15*(4*a^3 - 3*a*b^2)*cos(d*x + c)^5*log(sin(d*x + c) + 1) - 15*(4*a^3 - 3*a*b^2)*cos(d*x + c)^5*log(-si
n(d*x + c) + 1) + 48*b^3 + 80*(3*a^2*b - b^3)*cos(d*x + c)^2 + 30*(6*a*b^2*cos(d*x + c) + (4*a^3 - 3*a*b^2)*co
s(d*x + c)^3)*sin(d*x + c))/(d*cos(d*x + c)^5)

Sympy [F(-1)]

Timed out. \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\text {Timed out} \]

[In]

integrate(sec(d*x+c)**6*(a*cos(d*x+c)+b*sin(d*x+c))**3,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 157, normalized size of antiderivative = 0.99 \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {45 \, a b^{2} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {240 \, a^{2} b}{\cos \left (d x + c\right )^{3}} - \frac {16 \, {\left (5 \, \cos \left (d x + c\right )^{2} - 3\right )} b^{3}}{\cos \left (d x + c\right )^{5}}}{240 \, d} \]

[In]

integrate(sec(d*x+c)^6*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

1/240*(45*a*b^2*(2*(sin(d*x + c)^3 + sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - log(sin(d*x + c)
+ 1) + log(sin(d*x + c) - 1)) - 60*a^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(
d*x + c) - 1)) + 240*a^2*b/cos(d*x + c)^3 - 16*(5*cos(d*x + c)^2 - 3)*b^3/cos(d*x + c)^5)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 333 vs. \(2 (144) = 288\).

Time = 0.38 (sec) , antiderivative size = 333, normalized size of antiderivative = 2.11 \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (60 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 45 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 360 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 120 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 270 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 240 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 480 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 80 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 120 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 270 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 240 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 80 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 60 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 45 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, a^{2} b + 16 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \]

[In]

integrate(sec(d*x+c)^6*(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="giac")

[Out]

1/120*(15*(4*a^3 - 3*a*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(4*a^3 - 3*a*b^2)*log(abs(tan(1/2*d*x + 1/
2*c) - 1)) + 2*(60*a^3*tan(1/2*d*x + 1/2*c)^9 + 45*a*b^2*tan(1/2*d*x + 1/2*c)^9 - 360*a^2*b*tan(1/2*d*x + 1/2*
c)^8 - 120*a^3*tan(1/2*d*x + 1/2*c)^7 + 270*a*b^2*tan(1/2*d*x + 1/2*c)^7 + 720*a^2*b*tan(1/2*d*x + 1/2*c)^6 -
240*b^3*tan(1/2*d*x + 1/2*c)^6 - 480*a^2*b*tan(1/2*d*x + 1/2*c)^4 - 80*b^3*tan(1/2*d*x + 1/2*c)^4 + 120*a^3*ta
n(1/2*d*x + 1/2*c)^3 - 270*a*b^2*tan(1/2*d*x + 1/2*c)^3 + 240*a^2*b*tan(1/2*d*x + 1/2*c)^2 - 80*b^3*tan(1/2*d*
x + 1/2*c)^2 - 60*a^3*tan(1/2*d*x + 1/2*c) - 45*a*b^2*tan(1/2*d*x + 1/2*c) - 120*a^2*b + 16*b^3)/(tan(1/2*d*x
+ 1/2*c)^2 - 1)^5)/d

Mupad [B] (verification not implemented)

Time = 26.53 (sec) , antiderivative size = 293, normalized size of antiderivative = 1.85 \[ \int \sec ^6(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (a^3+\frac {3\,a\,b^2}{4}\right )-2\,a^2\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {9\,a\,b^2}{2}-2\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {9\,a\,b^2}{2}-2\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,a^2\,b-\frac {4\,b^3}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (8\,a^2\,b+\frac {4\,b^3}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (12\,a^2\,b-4\,b^3\right )+\frac {4\,b^3}{15}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^3+\frac {3\,a\,b^2}{4}\right )-6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,a\,b^2}{4}-a^3\right )}{d} \]

[In]

int((a*cos(c + d*x) + b*sin(c + d*x))^3/cos(c + d*x)^6,x)

[Out]

(tan(c/2 + (d*x)/2)^9*((3*a*b^2)/4 + a^3) - 2*a^2*b - tan(c/2 + (d*x)/2)^3*((9*a*b^2)/2 - 2*a^3) + tan(c/2 + (
d*x)/2)^7*((9*a*b^2)/2 - 2*a^3) + tan(c/2 + (d*x)/2)^2*(4*a^2*b - (4*b^3)/3) - tan(c/2 + (d*x)/2)^4*(8*a^2*b +
 (4*b^3)/3) + tan(c/2 + (d*x)/2)^6*(12*a^2*b - 4*b^3) + (4*b^3)/15 - tan(c/2 + (d*x)/2)*((3*a*b^2)/4 + a^3) -
6*a^2*b*tan(c/2 + (d*x)/2)^8)/(d*(5*tan(c/2 + (d*x)/2)^2 - 10*tan(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/2)^6 -
 5*tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 - 1)) - (atanh(tan(c/2 + (d*x)/2))*((3*a*b^2)/4 - a^3))/d